import {
  FormBuilder,
  FormsModule,
  ReactiveFormsModule,
  Validators,
} from '@angular/forms';
import { NzFormModule } from 'ng-zorro-antd/form';
import { Component } from '@angular/core';
import { NzInputModule } from 'ng-zorro-antd/input';
import { NzButtonModule } from 'ng-zorro-antd/button';

@Component({
  selector: 'app-form-horizontal-login-demo',
  standalone: true,
  imports: [
    NzFormModule,
    FormsModule,
    ReactiveFormsModule,
    NzInputModule,
    NzButtonModule,
  ],
  templateUrl: './form-horizontal-login-demo.component.html',
  styleUrl: './form-horizontal-login-demo.component.less',
})
export class FormHorizontalLoginDemoComponent {
  validateForm = this.fb.group({
    username: ['', [Validators.required]],
    password: ['', [Validators.required]],
    remember: [true],
  });

  constructor(private fb: FormBuilder) {}

  onSubmit() {
    const input = this.validateForm.value;
    console.log(input);
  }
}
